﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessLibrary.DAL;


namespace BusinessLibrary.BLL
{
    class Etudiant
  {
         # region var
        public int  Id { get; set; }
        public string Nom { get; set; }
        public string Prenom { get; set; }
        public int Cin { get; set; }
        public string Num_tel { get; set; }
        public string Email { get; set; }
        public string Num_inscription { get; set; }
           
        public Niveau niveau { get; set; }
        public Classe classe { get; set; }
        public Groupe groupe { get; set; }
        public Ville ville { get; set; }
        public Authentification authentification { get; set; }
        public Specialite specialite { get; set; }
      
        

        #endregion
        #region methodes
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static Etudiant GetEtudiantById(int id)
        {
            return sqlEtudiant.GetEtudiantById(id);
        }


        public static int deleteEtudiant(int id, int idAuthent)
        {
            return sqlEtudiant.deletEtudiant(id, idAuthent);
        }


        public static int SaveEtudiant(Etudiant e)
        {
            int nbRow;
            if ((nbRow = sqlEtudiant.updateEtudiant(e)) > 0)
                return nbRow;
            else
                return sqlEtudiant.insertEtudiant(e);
        }
    }
        #endregion
    }